This blog was written by Vallabh Chole & Oliver Devane
Over the years, the cybersecurity industry has seen many threats get taken down, such as the Emotet takedown in January 2021. It doesn’t usually take long for another threat to attempt to fill the gap left by the takedown. Hancitor is one such threat.
Like Emotet, Hancitor can send Malspams to spread itself and infect as many users as possible. Hancitor’s main purpose is to distribute other malware such as FickerStealer, Pony, CobaltStrike, Cuba Ransomware and Zeppelin Ransomware. The dropped Cobalt Strike beacons can then be used to move laterally around the infected environment and also execute other malware such as ransomware.
This blog will focus on a new technique used by Hancitor created to prevent crawlers from accessing malicious documents used to download and execute the Hancitor payload.
The infection flow of Hancitor is shown below:
A victim will receive an email with a fake DocuSign template to entice them to click a link. This link leads him to feedproxy.google.com, a service that works similar to an RSS Feed and enables site owners to publish site updates to its users.
When accessing the link, the victim is redirected to the malicious site. The site will check the User-Agent of the browser and if it is a non-Windows User-Agent the victim will be redirected to google.com.
If the victim is on a windows machine, the malicious site will create a cookie using JavaScript and then reload the site.
The code to create the cookie is shown below:
The above code will write the Timezone to value ‘n’ and the time offset to UTC in value ‘d’ and set it into cookie header for an HTTP GET Request.
For example, if this code is executed on a machine with timezone set as BST the values would be:
d = 60
n = “Europe/London”
These values may be used to prevent further malicious activity or deploy a different payload depending on geo location.
Upon reloading, the site will check if the cookie is present and if it is, it will present them with the malicious document.
A WireShark capture of the malicious document which includes the cookie values is shown below:
The document will prompt them to enable macros and, when enabled, it will download the Hancitor DLL and then load it with Rundll32.
Hancitor will then communicate with its C&C and deploy further payloads. If running on a Windows domain, it will download and deploy a Cobalt Strike beacon.
Hancitor will also deploy SendSafe which is a spam module, and this will be used to send out malicious spam emails to infect more victims.
Conclusion
With its ability to send malicious spam emails and deploy Cobalt Strike beacons, we believe that Hancitor will be a threat closely linked to future ransomware attacks much like Emotet was. This threat also highlights the importance of constantly monitoring the threat landscape so that we can react quickly to evolving threats and protect our customers from them.
IOCs, Coverage, and MITRE
IOCs
IOC | Type | IOC | Coverage | Content Version |
Malicious Document | SHA256 | e389a71dc450ab4077f5a23a8f798b89e4be65373d2958b0b0b517de43d06e3b | W97M/Dropper.hx
|
4641 |
Hancitor DLL | SHA256 | c703924acdb199914cb585f5ecc6b18426b1a730f67d0f2606afbd38f8132ad6
|
Trojan-Hancitor.a | 4644 |
Domain hosting Malicious Document | URL | http[:]//onyx-food[.]com/coccus.php | RED | N/A |
Domain hosting Malicious Document
|
URL | http[:]//feedproxy[.]google[.]com/~r/ugyxcjt/~3/4gu1Lcmj09U/coccus.php | RED | N/A |
Mitre
Technique ID | Tactic | Technique details |
T1566.002 | Initial Access | Spam mail with links |
T1204.001 | Execution | User Execution by opening link. |
T1204.002 | Execution | Executing downloaded doc |
T1218 | Defence Evasion | Signed Binary Execution Rundll32 |
T1055 | Defence Evasion | Downloaded binaries are injected into svchost for execution |
T1482 | Discovery | Domain Trust Discovery |
T1071 | C&C | HTTP protocol for communication |
T1132 | C&C | Data is base64 encoded and xored |